package com.xueyi.aixihu.reqeust;

import com.xueyi.aixihu.exception.SzException;
import com.xueyi.aixihu.status.SystemCode;
import lombok.Data;

import javax.validation.constraints.NotBlank;


/**
 * @authoer:hxs
 * @createDate:2022/8/16
 * @description: 修改文章现实状态参数
 */
@Data
public class ArticleStatusReq {
    /**
     * 文章id
     */

    @NotBlank(message = "参数异常")
    private String articleIdStr;
    private Integer articleId;

    public void format() throws SzException {
        try {
            this.articleId = Integer.parseInt(this.articleIdStr.trim());
        } catch (Exception e) {
            throw new SzException(SystemCode.QUERY_CHECK_ERROR, "参数类型错误");
        }
    }
}
